package com.xiaowei.gym.gymjsp.ware.service.impl;

import com.xiaowei.gym.gymjsp.ware.dao.SalaryDao;
import com.xiaowei.gym.gymjsp.ware.dao.impl.SalaryDaoImpl;
import com.xiaowei.gym.gymjsp.ware.entity.SalaryEntity;
import com.xiaowei.gym.gymjsp.ware.service.SalaryService;

import java.util.List;

public class SalaryServiceImpl implements SalaryService {

    private SalaryDao salaryDao;

    public SalaryServiceImpl() {
        salaryDao = new SalaryDaoImpl();
    }

    @Override
    public int createSalary(SalaryEntity salaryEntity) {
        return salaryDao.createSalary(salaryEntity);
    }

    @Override
    public int getSalaryCount() {
        return salaryDao.getSalaryCount();
    }

    @Override
    public List<SalaryEntity> getSalaryList(String queryUserName, int currentPageNo, int pageSize) {
        return salaryDao.getSalaryList(queryUserName,currentPageNo,pageSize);
    }

    @Override
    public SalaryEntity getSalaryById(Integer id) {
        return salaryDao.getSalaryById(id);
    }

    @Override
    public boolean modify(SalaryEntity salaryEntity) {
        Integer modify = salaryDao.modify(salaryEntity);
        if (modify != null){
            return true;
        }else {
            return false;
        }

    }

    @Override
    public Boolean deleteSalaryByIds(Integer[] delId) {
        int[] ints = salaryDao.deleteSalaryByIds(delId);
        if (ints.length > 0 || ints != null){
            return true;
        }else {
            return false;
        }

    }
}
